package org.csu.mypetstore.service;

import org.csu.mypetstore.persistence.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class LogService {

    @Autowired
    private LogMapper logMapper;

    public void insertLogInfo(String username, String logInfo) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date(System.currentTimeMillis());
        logMapper.insertLog(username, logInfo);
    }
}
